#include "stdafx.h"
#include "bbAddon.h"

typedef unsigned char uchar;
typedef uchar * achar;

#define PI 3.14159265f

const int TobbObject(void*obj) {return reinterpret_cast<int>(obj);};

BBAEXP const float BBACALL Min( const float a, const float b )
{if (b<a) {return b;};return a;};

BBAEXP const float BBACALL Max( const float a, const float b )
{if (b>a) {return b;};return a;};

BBAEXP const float BBACALL LinearInterp ( const float a, const float b, const float rate )
{return a+(b-a)*rate;};

BBAEXP const float BBACALL CosInterp ( const float a, const float b, const float rate )
{return (a+((1-cosf(rate*PI))*.5f)*(b-a));};

BBAEXP const float BBACALL CubicInterp(const float a,const float b,const float c,const float d,const float rate)
{return (((d-c-a+b)*rate+(a+a-b-b-d+c))*rate+c-a)*rate+b;}
